﻿#ifndef __HOMECONTROLLER__
#define __HOMECONTROLLER__

#include "BaseKit.h"

class HomeController:public CAViewController{
public:
	CREATE_FUNC(HomeController);
protected:
	HomeController();
	virtual ~HomeController();
	void viewDidLoad();
	void bananerData(const string& data);
	void bananers();
	void infoData(const string& data);
	void typeData(const string& data);
	void scrollViewHeaderBeginRefreshing();
	void scrollViewFooterBeginRefreshing();
	virtual void collectionViewDidSelectCellAtIndexPath(unsigned int section, unsigned int item);
	virtual void collectionViewDidDeselectCellAtIndexPath(unsigned int section, unsigned int item);
	virtual CACollectionViewCell* collectionCellAtIndex(const DSize& cellSize, unsigned int section, unsigned int item);
	virtual DSize collectionViewCellSizeAtIndexPath(unsigned int section, unsigned int item);
	virtual unsigned int numberOfItemsInSection(unsigned int section);
	void commodityData(const string& data);
private:
	int size;
	int selectType=0;
	CAVector<CAView*> imgs;
	CAPageView* pageView;
	CAPageControl* pageControl;
	CAPageView* pageInfo;
	int page=0;
	unsigned int typeCode=0;
	CSJson::Value commodityDatas;
	CAAutoCollectionView* commoditys;
};

#endif